Field of the Invention
The present invention relates to a communication apparatus, a control method thereof, and a storage medium, and relates to a communication apparatus using packet transmission, a control method thereof, and a storage medium.
Description of the Related Art
There is a known communication apparatus that performs a communication (for example, a wireless direct communication) that is realized by being directly connected with another communication apparatus, in addition to a communication (for example, a wired LAN communication) that is realized by being connected with another communication apparatus via a plurality of paths. Such a communication apparatus performs a TCP/IP communication with another communication apparatus and, in TCP/IP communication, a maximum amount of data which can be transmitted in a single transfer process is set as an MTU (Maximum Transmission Unit) value. Here, when a relatively large amount of data is transmitted, the communication apparatus divides and allocates the data to be transmitted into a plurality of transmission packets so that the data amount (size) of a single transmission packet does not exceed the MTU value.
As described above, the communication apparatus can communicate with another communication apparatus by communications in various modes (such as a wired LAN communication and a wireless direct communication), and maximum transmittable amount of data are not the same in communication in the respective modes (hereinafter, referred to as a “maximum transmittable data amount”). For example, in the wired LAN communication, the maximum transmittable data amount is determined based on a transmittable data amount of a path having the smallest transmittable data amount among the respective paths that constitutes the wired LAN. On the other hand, in the wireless direct communication, the maximum transmittable data amount is not determined based on the transmittable data amount of a path since any path does not exist.
Further, in the communication in any mode, a transmission packet in a size that exceeds the maximum transmittable data amount of the communication cannot be efficiently and certainly transmitted. For example, in the wired LAN communication, a transmission packet in a size that exceeds the maximum transmittable data amount may be divided into a plurality of transmission packets, and this may result in a longer data transmission period. Further, a transmission packet in the size that exceeds the maximum transmittable data amount may be discarded as an untransmittable transmission packet. Here, by setting a data amount that does not exceed the maximum transmittable data amount of the communication in each mode as an MTU value and then using a transmission packet in a size which does not exceed the MTU value, the transmission packet can be efficiently and certainly transmitted in the communication in each mode.
As a method to set the MTU value properly, for example, the applicant has proposed a method for detecting a data length of a transmission packet which can be transferred without being divided and setting an MTU value based on the detected data length in a logical connection (VPN) (for example, see Japanese Patent Application Laid-Open No. 2009-171307). Further, there is a known method for displaying an MTU value set menu on an operation unit of a communication apparatus, which is a display panel for example, and setting, by a user, a single proper MTU value using the MTU value set menu as considering the maximum transmittable data amount of the communication in each mode. In the both methods, the set single MTU value is applied to the communications in all modes, and a transmission packet in a size which does not exceed the MTU value is transmitted in the communication in each mode.
However, the single MTU value set in the above described methods is a data amount which does not exceed the maximum transmittable data amount of the communication in each mode and, in other words, it corresponds to a minimum value of the maximum transmittable data amounts of the communications in the respective modes. Thus, there may be a case that, in a wireless direct communication which has a relatively large maximum transmittable data amount for example, a transmission packet which is considerably smaller than the maximum transmittable data amount of the wireless direct communication is transmitted. This may cause an unnecessary deterioration of the data transmission performance when transmitting data using a transmission packet.